let obj = {name: "后盾人"};
let hd = {
  web: "houdunren.com"
};

//设置hd为obj的新原型
Object.setPrototypeOf(obj, hd);
console.log(obj);
console.log(obj.name, obj.web);


const names = Object.getOwnPropertyNames(hd)
console.log(names)


var arr = ["a", "b", "c"];
console.log(Object.getOwnPropertyNames(arr)); 
console.log(Object.getOwnPropertyNames(arr).sort()); // ["0", "1", "2", "length"]

// length 是数组中 不可枚举的属性，但是数组实例本身的属性
console.log(arr.hasOwnProperty('length'), 'length' in arr)
console.log(arr.hasOwnProperty('concat'), 'concat' in arr)
console.log('-----------------------\n')

Array.prototype.a = 'sdfsd'
var arr = ["a", "b", "c"];
console.log(Object.keys(arr))
console.log(arr.a)
